package edu.jptest.serviceImp;

import java.util.List;

import edu.jptest.bean.QuestionSubject;
import edu.jptest.dao.QuestionSubjectDAO;
import edu.jptest.service.IQuestionSubjectService;

public class QuestionSubjectService implements IQuestionSubjectService {

	// 插入题目
	public boolean insertQuestionSubject(QuestionSubject questionSubject) {
		QuestionSubjectDAO questionSubjectDao = new QuestionSubjectDAO();
		return questionSubjectDao.insertQuestionSubject(questionSubject);
	}

	// 删除题目
	public boolean deleteQuestionSubject(int questionSubject_id) {
		QuestionSubjectDAO questionSubjectDao = new QuestionSubjectDAO();
		return questionSubjectDao.deleteQuestionSubject(questionSubject_id);
	}

	// 修改题目
	public boolean updateQuestionSubject(QuestionSubject questionSubject) {
		QuestionSubjectDAO questionSubjectDao = new QuestionSubjectDAO();
		return questionSubjectDao.updateQuestionSubject(questionSubject);
	}

	// 通过题目id，查询题目对象
	public QuestionSubject getQuestionSubjectByQuestionSubjectId(
			int questionSubject_id) {
		QuestionSubjectDAO questionSubjectDao = new QuestionSubjectDAO();
		return questionSubjectDao
				.getQuestionSubjectByQuestionSubjectId(questionSubject_id);
	}

	// 通过题目序号和内容，查询题目id
	public int getQuestionSubjectIdByQuestionSubject(int questionSubjectNum,
			String questionSubjectContent) {
		QuestionSubjectDAO questionSubjectDao = new QuestionSubjectDAO();
		return questionSubjectDao.getQuestionSubjectIdByQuestionSubject(
				questionSubjectNum, questionSubjectContent);
	}

	// 获得所有题目id
	public List<Integer> getAllQuestionSubjectsId() {
		QuestionSubjectDAO questionSubjectDao = new QuestionSubjectDAO();
		return questionSubjectDao.getAllQuestionSubjectsId();
	}
}